package com.mostromas.ess.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.mostromas.ess.entities.Fabric;
import com.mostromas.ess.entities.FabricComposition;
import com.mostromas.ess.product.req.FabricREQ;
import com.mostromas.ess.util.base.Result;

import java.util.List;

public interface IFabricService extends IService<Fabric> {

    Result queryPage(FabricREQ req);

    /**
     * 保存面料成分中间表
     * @param entity
     *
     * @param compositionList
     * @return
     */
    Result saveFabricComposition(Fabric entity, List<FabricComposition> compositionList);

    /**
     * 查询面料详情
     * @param fabricId
     * @return
     */
    Result findDetailsById(String fabricId);

    /**
     * 修改面料详情，更新中间表
     * @param entity
     * @param compositionList
     * @return
     */
    Result updateDetails(Fabric entity, List<FabricComposition> compositionList);

    /**
     * 根据款式查询面料详情
     * @param productId
     * @return
     */
    Result findDetailsByProductId(String productId);
}
